<?php
// +----------------------------------------------------------------------
// | Tplay [ WE ONLY DO WHAT IS NECESSARY ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017 http://tplay.pengyichen.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 听雨 < 389625819@qq.com >
// +----------------------------------------------------------------------


namespace app\admin\model;

use \think\Model;
class Order extends Model
{

public function goods(){

    return $this->belongsTo('Goods');
}
    public function coupon(){
        return $this->belongsTo('Coupon');
    }




    public function member(){

        return $this->belongsTo('Member');
    }
    public function cancel($t=''){
        $a='';
        if ($t!=''){
          $b=  $this->where('order_id',$t)->update([
                'order_status'=>6
            ]);
            if ($b==true){
                $a=true;
                return $a;
            }else{
                $a=false;
                return $a;
            }

        }else{
            $a=false;
            return $a;
        }




    }



}
